package edu.purdue.touch.util;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

import TUIO.TuioCursor;

public class TouchLogger {
	private String name;
	private File outFile;
    private FileWriter out;
	
	public TouchLogger()
	{
		name  = Long.toString(System.currentTimeMillis());
		outFile = new File("./log/"+name+".csv");
	}
	
	public void addTouch(TuioCursor tcur)
	{
	
		try {			
			out = new FileWriter(outFile,true);
			out.write(System.currentTimeMillis()+","+tcur.getX()+","+tcur.getY()+"\n");
	        out.close();
		} catch (IOException e) {
			e.printStackTrace();
		}       
	}	
}
